package u1project.server;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author oldliu
 * @since 1.0
 */
public class MainServer {
    public static void main(String[] args) throws IOException {
        ServerSocket st=new ServerSocket(8888);
        ExecutorService ex= Executors.newFixedThreadPool(20);
        System.out.println("监听在8888端口！");
        while (true){
            final Socket socket=st.accept();
            ex.submit(new ServerThread(socket));
//            ex.submit(()->{
//
//            });
        }
    }
}
